package authentication

import (
	"github.com/gin-gonic/gin"
)

type AuthFlowContinue bool
type AuthFunc func(c *gin.Context) AuthFlowContinue

func DoAuthGroup() gin.HandlerFunc {
	var authFuncs = []AuthFunc{doPublicAuth, doBearerAuth, doJwtAuth, doAuthCover}
	return func(c *gin.Context) {
		for _, authFunc := range authFuncs {
			authFlowContinue := authFunc(c)
			if !authFlowContinue {
				return
			}
		}
	}
}
